<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Theme Template for Bootstrap</title>

    <!-- Custom styles for this template -->
    <link href="<c:url value="/css/bootstrap/theme.css"/>" rel="stylesheet">
	
	<link href="<c:url value="/css/jquery.dataTables_themeroller.css"/>" rel="stylesheet"/>
	<link href="<c:url value="/css/jquery.dataTables.min.css"/>" rel="stylesheet"/>    

<%-- 	<link href="<c:url value="/css/dataTables.jqueryui.css"/>" rel="stylesheet"/> --%>
	
<%-- 	<link href="<c:url value="/css/jquery-ui.css"/>" rel="stylesheet"/> --%>

    <!-- Bootstrap core CSS -->
    <link type="text/css" href="<c:url value="/css/bootstrap/bootstrap.min.css"/>" rel="stylesheet" />
    <!-- Bootstrap theme -->
    <link href="<c:url value="/css/bootstrap/bootstrap-theme.min.css"/>" rel="stylesheet">

    
  </head>

<style>

#example_wrapper{ 
 position:absolute;
 left:1%;
 bottom:5px;
 width:97%;
}

</style>

<body role="document">

    <!-- Fixed navbar -->
    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">Bootstrap theme</a>
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="#">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#contact">Contact</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
                <li class="divider"></li>
                <li class="dropdown-header">Nav header</li>
                <li><a href="#">Separated link</a></li>
                <li><a href="#">One more separated link</a></li>
              </ul>
            </li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>

    <div class="container theme-showcase" role="main">


	<table id="example" class="display" cellspacing="0" width="100%">
        <thead>
            <tr>
                <th>ID</th>
                <th>Data da Dívida</th>
                <th>Data do Pagamento</th>
                <th>Descrição</th>
                <th>Valor</th>
                <th>Observação</th>                                
            </tr>
        </thead>
        <tfoot>
            <tr>
                <th colspan="2">COPIRÁITI</th>
            </tr>
        </tfoot>
    </table>


    </div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="<c:url value="/js/jquery.js"/>"></script>
    <script src="<c:url value="/js/bootstrap/bootstrap.min.js"/>"></script>
<%--     <script src="<c:url value="/js/bootstrap/docs.min.js"/>"></script> --%>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="<c:url value="/js/bootstrap/ie10-viewport-bug-workaround.js"/>"></script>
	<script src="<c:url value="/js/jquery.dataTables.min.js"/>"></script>
	
<script type="text/javascript">
	$(document).ready(function(){
	
		var selected = [];
		
		$("#example").dataTable( {
		    "bProcessing": false,
		    "bServerSide": false,
		    "sort": "position",
		    "scrollY": "200px",
	        "scrollCollapse": true,	    
		    "sAjaxSource": "http://localhost:8080/statizo-financeiro-web/rest/banks",
		    "aoColumns": [
		        { "mData": "id" },
		        { "mData": "dataDivida" },
		        { "mData": "dataPagamento" },
		        { "mData": "descricao" },
		        { "mData": "valor" },
		        { "mData": "observacao" }	        
		        ]
		} );
	
	    $('#example tbody').on('click', 'tr', function () {
	        var id = this.id;
	        var index = $.inArray(id, selected);
	 
	        if ( index === -1 ) {
	            selected.push( id );
	        } else {
	            selected.splice( index, 1 );
	        }
	 
	        $(this).toggleClass('selected');
	    } );
	
		
	});
	
</script>	
	
  </body>
</html>